/*
package com.diligent.cloud.sfc.config;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationDetails;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;

*/

/**
 * FeignHeaderConfig class
 *
 * @author xf107278
 * @date 3/30/2020
// */
//
//@Configuration
//public class FeignHeaderConfig implements RequestInterceptor {
//    @Override
//    public void apply(RequestTemplate requestTemplate) {
//        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder
//                .getRequestAttributes();
//        HttpServletRequest request = attributes.getRequest();
//        Enumeration<String> headerNames = request.getHeaderNames();
//       while (headerNames.hasMoreElements()){
//           String key = headerNames.nextElement();
//           requestTemplate.header(key,request.getHeader(key));
//       }
//       requestTemplate.header()
//
////        SecurityContext securityContext = SecurityContextHolder.getContext();
////        Authentication authentication = securityContext.getAuthentication();
////        OAuth2AuthenticationDetails oAuth2AuthenticationDetails = (OAuth2AuthenticationDetails)authentication.getDetails();
//       // requestTemplate.header("Authorization","Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXJyZW50VGltZSI6MTU5MDYyOTYxNSwidXNlckluZm8iOnsiaWQiOjQ0MjAwOTM0Mjk2NzgwODIsInVuaW9uQ29kZSI6IjQ2IiwiYWNjb3VudE5hbWUiOiJ4ZjEyMCIsImFjY291bnRDb2RlIjoieGYxMjAiLCJwYXNzd29yZCI6IiQyYSQxMCRDck05QlRMOFpSYTdneE5Dc0xiVTQuU3B1QjNRc3Q2c05QU05FVzdNdEVrWEtDNmdYd0dpYSIsImVtYWlsIjoiMTA0MjEyMDMyM0BxcS5jb20iLCJwaG9uZSI6IjE1NjI1MjMwMDAwIiwiaW5hY3RpdmVkIj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